From: Jasper St. Pierre Date: Mon, 23 Jul 2012 01:15:36 +0000 (-0300) Subject: st-theme: Make the custom stylesheets have higher priority X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6274 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=75e49610cbed17ae312ddd896f07503842390d27;p=gnome-shell.git st-theme: Make the custom stylesheets have higher priority https://bugzilla.gnome.org/show_bug.cgi?id=680426 --- diff --git a/src/st/st-theme.c b/src/st/st-theme.c index adb29db99..42d75cb9b 100644 --- a/src/st/st-theme.c +++ b/src/st/st-theme.c @@ -176,6 +176,9 @@ parse_stylesheet (const char *filename, return NULL; } + /* Extension stylesheet */ + stylesheet->app_data = GUINT_TO_POINTER (FALSE); + return stylesheet; } @@ -230,6 +233,8 @@ st_theme_load_stylesheet (StTheme *theme, if (!stylesheet) return FALSE; + stylesheet->app_data = GUINT_TO_POINTER (TRUE); + insert_stylesheet (theme, path, stylesheet); cr_stylesheet_ref (stylesheet); theme->custom_stylesheets = g_slist_prepend (theme->custom_stylesheets, stylesheet); @@ -958,6 +963,7 @@ compare_declarations (gconstpointer a, /* g_ptr_array_sort() is broooken */ CRDeclaration *decl_a = *(CRDeclaration **) a; CRDeclaration *decl_b = *(CRDeclaration **) b; + gboolean a_is_extension_sheet, b_is_extension_sheet; int origin_a = get_origin (decl_a); int origin_b = get_origin (decl_b); @@ -968,6 +974,12 @@ compare_declarations (gconstpointer a, if (decl_a->parent_statement->specificity != decl_b->parent_statement->specificity) return decl_a->parent_statement->specificity - decl_b->parent_statement->specificity; + a_is_extension_sheet = GPOINTER_TO_UINT (decl_a->parent_statement->parent_sheet->app_data); + b_is_extension_sheet = GPOINTER_TO_UINT (decl_b->parent_statement->parent_sheet->app_data); + + if (a_is_extension_sheet != b_is_extension_sheet) + return a_is_extension_sheet ? 1 : -1; + return 0; }